﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>节点ICON </title>
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../Scripts/config.js"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <base target="_self" />

    <script type="text/javascript" language="javascript">
        //页面启动函数.
        $(function () {

            var fk_flow = GetQueryString('FK_Flow');

            //初始化表格.
            $.ajax({
                type: 'post',
                async: true,
                url: Handler + "?DoType=NodesIcon_Init&FK_Flow=" + GetQueryString("FK_Flow") + "&m=" + Math.random(),
                dataType: 'html',
                success: function (data) {

                    if (data.indexOf('err@') == 0) {
                        alert(data);
                        return;
                    }

                    data = JSON.parse(data);

                    //取出来两个集合.
                    var nodes = data['Nodes'];
                    var icons = data['ICONs'];

                    var html = '';
                    for (var i = 0; i < icons.length; i++) {

                        var icon = icons[i];

                        var fileName = icon.No;

                        html += "&nbsp;&nbsp;<img class='icon'  src='../ClientBin/NodeIcon/" + icon.No + ".png' style='width:60px;height:60px;'  onclick=\"SelectIt('" + icon.No + "')\" alt='" + icon.No + "'  />";
                    }
                    document.getElementById('docs').innerHTML = html;

                }
            });
        });

        function SelectIt(str) {

            var url = Handler + "?DoType=NodesIconSelect_Save&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + GetQueryString("FK_Node") + "&Icon=" + str + "&m=" + Math.random();
            $.ajax({
                type: 'post',
                async: true,
                url: url,
                dataType: 'html',
                success: function (data) {

                    if (data.indexOf('err@') == 0) {
                        alert(data);
                        return;
                    }
                    window.location.href = 'NodesIcon.htm?FK_Flow=' + GetQueryString('FK_Flow');
                }
            })
        }
    </script>

    <style type="text/css">
    li 
    {
        padding:3px 0;
        }
    </style>
    
</head>
<body onkeypress="Esc();" style="font-size: smaller">
    <form method="post" id="form1">    
    <div style="margin:8px">
        <table id="Table1" style="width: 100%">
            <caption>
               请选择一个ICON
            </caption>
            <tr>
              <td>
              <div id='docs' ></div>
              </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
